<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Non-props属性</title>
    <style>
      * {
        user-select: none;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <script src="https://unpkg.com/vue@next"></script>

    <div id="root"></div>

    <script>
      const app = Vue.createApp({
        data() {
          return {};
        },

        template: `<div>
                        <counter msg1="hello" msg2="world"/>  
                    </div>`,
      });

      app.component("counter", {
        //inheritAttrs:false,
        
        mounted(){
          console.log(this.$attrs.msg1);
        },

        template: `
                    <div :msg1="$attrs.msg1">yunmu</div>
                    <div v-bind="$attrs">yunmu</div>
                    <div :msg2="$attrs.msg2">yunmu</div>
              `,
      });

      const vm = app.mount("#root");
    </script>
  </body>
</html>
